cmake_minimum_required(VERSION 3.10)
project(libuv_test C)

# 设置 C 标准
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)

# 添加头文件路径
include_directories(${CMAKE_SOURCE_DIR}/include)

# 添加 libuv 的库文件路径
link_directories(${CMAKE_SOURCE_DIR}/lib)

# 收集源文件
file(GLOB SOURCES 
    "*.c"
    "src/*.c"
)

# 添加可执行文件
add_executable(main ${SOURCES})

# 链接 libuv 和所需的系统库
target_link_libraries(main
        PRIVATE
        uv
        ws2_32
        psapi
        userenv
        iphlpapi
)

# 设置静态链接
set_target_properties(main PROPERTIES
        LINK_FLAGS "-static"
)